<script type="text/javascript" src="jquery-1.8.3.min.js"></script>
<link rel="stylesheet"  type="text/css"  href="bootstrap.css" >
<html>
<head>
    <meta charset="utf-8">
    <title>Title</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }
        html {
            height: 100%;
        }
        body {
            background:url(https://img.51miz.com/Element/00/59/33/44/6766b1bb_E593344_6baa5e03.jpg)no-repeat center center;
            height: 100%;
            width: 100%;
            background-size:cover;
            position:absolute;
            left:0;
            top:0
        }
    </style>
</head>
<body>
<div class="container">
    <div class="col-md-4"></div>
    <div class="col-md-4" style="background-color:#eee;;margin-top:200px;">
        <center>
            <h3>我的信息如下</h3>
        </center>
        <form id="form-login" action="login" method="post">
            <div class="form-group">
                <label for="username">用户名:</label>
                <input type="text" disabled name="username" id="username" value="" class="form-control" style="color:red;">
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="text" disabled name="password" id="password" value="" class="form-control" style="color:red;">
            </div>
            <div class="form-group">
                <label for="xingming">姓名</label>
                <input type="text" disabled name="xingming" id="xingming" value="" class="form-control" style="color:red;">
            </div>
            <div class="form-group">
                <label for="shenfen">身份</label>
                <input type="text" disabled name="shenfen" id="shenfen" value="" class="form-control" style="color:red;">
            </div>

        </form>
    </div>
    <div class="col-md-4"></div>
</div>
</body>
</html>
<script>
    $(function () {
        f1();
    })
    function f1(){
        $.ajax({
            url: "findXinxi",
            type: "post",
            async: false,
            cache: false,
            dataType: "json",
            "success": function (json) {
                console.log(json)
                $("#username").val(json.username);
                $("#password").val(json.password);
                $("#xingming").val(json.xingming);
                if("1"==json.shenfen){
                    $("#shenfen").val('教师');
                }else{
                    $("#shenfen").val('学生');
                }
            }
        });

    }
</script>